<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height border-hover-style">
    <div
      class="content outline-parent-bg"
      :style="{
        backgroundImage: `url(${publicUrls + 'free/style7/Level1outlineStyle2Bg.webp'})`,
      }"
    >
      <div class="Showroom-parent" v-if="props.info.digitalShowroom">
        <digitalShowroomIcon :url="props.info.digitalShowroom" :id="props.info.id" />
      </div>
      <div
        class="title-box"
        :style="{
          backgroundImage: `url(${
            publicUrls +
            (props.info.text.length > 8
              ? 'free/style7/Level1outlineStyle2Bgtitle2.webp'
              : 'free/style7/Level1outlineStyle2Bgtitle1.webp')
          })`,
        }"
        :class="{
          'title-box-2': props.info.text.length > 8,
        }"
      >
        <p>{{ props.info.text }}</p>
      </div>
      <p
        class="subtitle"
        :class="{
          'subtitle-2': !props.info.value,
        }"
        v-if="props.info.subTitle"
      >
        ——{{ props.info.subTitle }}
      </p>

      <div
        :style="{
          backgroundImage: `url(${
            publicUrls +
            (!props.info.remarks
              ? 'free/style7/Level1outlineStyle2Bgimg2.png?imageView2/format/webp'
              : 'free/style7/Level1outlineStyle2Bgimg1.png?imageView2/format/webp')
          })`,
        }"
        class="img-box"
        :class="{
          'img-box1': !props.info.remarks,
        }"
        v-if="props.info.value"
      >
        <div class="outline-cover">
          <img @click="ImgVisible = true" :src="urls + props.info.value + '?imageView2/3/format/webp'" alt="" />
        </div>
      </div>
      <div class="remarks1" v-if="props.info.value">
        <TextMax
          :infoData="props.info"
          v-if="props.domShow"
          :data="props.info.remarks"
          :title="props.info.text"
          :row="!props.info.subTitle ? 9 : getRemarksNum(7, route.meta.loopType)"
        ></TextMax>
      </div>
      <div
        class="remarks2"
        :class="{
          remarks3: !props.info.subTitle,
        }"
        v-else-if="props.info.remarks"
      >
        <TextMax
          :infoData="props.info"
          v-if="props.domShow"
          :data="props.info.remarks"
          :title="props.info.text"
          :row="!props.info.subTitle ? getRemarksNum(18, route.meta.loopType) : getRemarksNum(15, route.meta.loopType)"
        ></TextMax>
      </div>
    </div>
  </div>
</template>  

<script lang="ts">
export default defineComponent({
  name: 'free3Style1',
});
</script> 
   
<script setup lang="ts">
import { getRemarksNum } from '@/utils/minxin';
import digitalShowroomIcon from '@/freeComponents/unitdigitalShowroom/style7.vue';
import { publicUrls } from '@/utils/minxin';
import { getTextHtml, textType } from '@/utils/minxin';
import { urls } from '@/utils/request/upload';
import { computed, defineComponent, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/textMax7.vue';
import { useProjectStore } from '@/store';
import { useRouter, useRoute } from 'vue-router';
const route = useRoute();
const ImgVisible = ref(false);
const store = useProjectStore();
const title = ref();

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  position: relative;
  margin-right: 200px;
  // margin-left: 120px;
  margin-top: 0;
}
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 660px;
  height: 100%;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  // box-shadow: 8px 6px 4px 0px rgba(2, 2, 2, 0.1);
  padding: 58px 86px;
}
.Showroom-parent {
  display: flex;
  position: absolute;
  top: 0px;
  right: 90px;
  z-index: 15;
  width: 32px;
  height: 44px;
}
.title-box {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 392px;
  height: 80px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  padding: 16px 36px;
  :deep(p) {
    width: 100%;
    font-family: SourceBold;
    font-size: 32px;
    color: rgba(251, 244, 226, 1);
    line-height: 48px;
    text-align: center;
  }
}
.title-box-2 {
  padding: 16px 25px;
  display: flex;
  justify-content: space-between;
  width: 488px;
  height: 128px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

.subtitle {
  width: 480px;
  font-family: SourceMedium;
  font-size: 18px;
  color: rgba(51, 51, 51, 1);
  line-height: 28px;
  text-align: center;
  margin-top: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(112, 157, 134, 1);
}
.subtitle-2 {
}
.img-box {
  margin-top: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  padding: 0px 32px;
  // border-radius: 8px;
  width: 488px;
  height: 288px;
  .outline-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
    img {
      transition: all 0.3s;
      max-width: 100%;
      width: auto;
      height: 100%;
      object-fit: contain;
    }
  }
}
.img-box:hover {
  .outline-cover {
    img {
      transform: scale(1.3);
    }
  }
}
.img-box1 {
  width: 488px;
  height: 544px;
}

.remarks1 {
  width: 480px;
  margin-top: 32px;
}
.remarks2 {
  width: 480px;
  margin-top: 32px;
}
.remarks3 {
  margin-top: 32px;
}
</style>
